package cn.heapstack.jpa.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SecondaryTable;


@Entity(name="MPO_Customer_Using_IdClass")
@IdClass(CustomerPK.class)
@SecondaryTable(name="MPO_ADDRESS_TABLE",pkJoinColumns={
		@PrimaryKeyJoinColumn(name="ADDRESS_ID_1"),
		@PrimaryKeyJoinColumn(name="ADDRESS_ID_2")})
public class Customer {

	/**
	 * 主键自动生成功能不支持主键类 和 复合键
	 */
	private long ssn;
	private String firstName;
	private String lastName;
	
	private String street;
	private String city;
	private String state;
	
	@Column(table="MPO_ADDRESS_TABLE")
	public String getStreet() {
		return street;
	}
	public void setStreet(String street) {
		this.street = street;
	}
	@Column(table="MPO_ADDRESS_TABLE")
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	@Column(table="MPO_ADDRESS_TABLE")
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	
	@Id
	public long getSsn() {
		return ssn;
	}
	public void setSsn(long ssn) {
		this.ssn = ssn;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	@Id
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	
	
}
